﻿@{
    ViewBag.Title = "福建省烟草信息化运维管理系统首页";
    Layout = "~/Views/Shared/_LayoutThreeMain.cshtml";
    List<Wicresoft.UnifyShow.Business.ToDoModel> todos = (List<Wicresoft.UnifyShow.Business.ToDoModel>)ViewBag.ToDOs;
}
@section ScriptAndCss{
    <script src="../../Scripts/cic-main.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
          
          var url="@Url.Action("Table", "ToDoTable")";

          $("#reportRedirect").click(function(){
             var url="@Url.Action("Report", "Navigate")";
             window.open(url);
          });

          $("#ToDoTable").load(url,function(){
          InitToDo();
          });
          $("#ResourceTable").load("@Url.Action("List", "AdminDocument")",function()
          {
           $(".document","#ResourceTable").click(function () {
                window.open("@Url.Action("DownLoad", "AdminDocument")"+"?id="+$(this).attr("data-id"));
           });
          }
          );

        });
        function InitToDo() {
            PreventAAction("gridToDoTable");
            $("tr", $("tbody","#gridToDoTable")).click(function(){
                $(this).siblings().css("background-color", "white");
                $(this).css("background-color", "#ccc");
            });
            $("tr", $("tbody","#gridToDoTable")).dblclick(function () {
                $(this).siblings().css("background-color", "white");
                $(this).css("background-color", "#ccc");
                var type = $($(this).children()[1]).text();
                if (type == "自服务") {
                    window.open($("#selfUrl").val());
                }
                else {
                    window.open($("#itsmUrl").val());
                }
            });
        }
    </script>
}
@model Wicresoft.UnifyShow.Portal.Models.NavigateModel
<div class="box">
    <input type="hidden" value="@Url.Action("SSO", "Account", new { redirectionUrl = GlobalHelper.SelfUrl })" id="selfUrl" />
    <input type="hidden" value="@Url.Action("SSO", "Account", new { redirectionUrl = GlobalHelper.ITSMURL })" id="itsmUrl" />
    <div class="main_left">
        <div class="left_menu_Na">
            <div id="menu">
                <p class="VNavLeaf ui-icons">
                        <a id="SelfClick" target="_blank" href="@Url.Action("SSO", "Account", new { redirectionUrl = GlobalHelper.SelfUrl })">自服务平台</a></p>
                @if (!string.IsNullOrEmpty(Model.AccessITSMName))
                {                     
                    <p>
                        <a id="ITSMClick" target="_blank" href="@Url.Action("SSO", "Account", new { redirectionUrl = GlobalHelper.ITSMURL })">@Model.AccessITSMName</a></p>
                }
                @if (!string.IsNullOrEmpty(Model.AccessGJName))
                {   
                    <p>
                        <a id="gjMenu">@Model.AccessGJName</a></p>
                    <div class="VNavParentI" id="gjMenuDiv">
                        <ul style="display: none;" id="gjMenuUL">
                            @foreach (Wicresoft.UnifyShow.Business.SiteBranchModel sitebranch in Model.SiteBranch_GJ)
                            {                
                                <li class="VNavLeaf2"><a href="#" onclick="redirectbppm('@sitebranch.GJ_IPPort1');return false;">
                                    --@sitebranch.Alias--</a></li>
                            }
                        </ul>
                    </div>
                }
                @if (!string.IsNullOrEmpty(Model.AccessUSName))
                {                    
                    <p>
                        <a target="_blank" href="@Url.Action("Index", "Home")">@Model.AccessUSName</a></p>
                }
                @if ((bool)ViewBag.IsConfigAdmin)
                { 
                    <p>
                        <a href="@Url.Action("CreateUser", "AdminPermission")">管理员配置</a></p>
                }
                <p><a href="#report"  id="reportRedirect">报表</a></p>
            </div>
        </div>
    </div>
    <div class="main_right">
        <div class="index_lr">
            <ul style="width: 820px">
                <li style=" width: 820px; padding-left: 0px;">
                    <div class="index_lrA_title ui-icons" >
                        <h3>
                            待办事宜</h3>
                    </div>
                    <div id="ToDoTable" >
                    </div>
                </li>
                <li style="height: 152px; width: 820px ;padding-left: 0px;" >
                    <div class="index_lrA_title ui-icons">
                        <h3>
                            @* 在办事宜：*@</h3>
                    </div>
                    <div id="DoingTable" >
                    </div>
                </li>
                <li style=" width: 820px ;padding-left: 0px;">
                    <div class="index_lrA_title ui-icons">
                        <h3>
                            常用资源</h3>
                    </div>
                    <div id="ResourceTable">
                    </div>
                </li>
            </ul>
        </div>
        <div class="clear">
        </div>
    </div>
</div>
@*<table id="todo" class="talbe_gray" width="570" height="500" border="0" cellpadding="0"
                    cellspacing="0">
                    <thead>
                        <tr>
                            <th height="25" width="10%" class="altrow">
                                请求 ID
                            </th>
                            <th height="25" width="10%" class="altrow">
                                请求类型
                            </th>
                            <th height="25" width="10%" class="altrow">
                                操作
                            </th>
                            <th height="25" width="10%" class="altrow">
                                摘要
                            </th>
                            <th height="25" width="10%" class="altrow">
                                状态
                            </th>
                            <th height="25" width="10%" class="altrow">
                                优先级
                            </th>
                            <th height="25" width="10%" class="altrow">
                                受派者组
                            </th>
                            <th height="25" width="10%" class="altrow">
                                受派者
                            </th>
                            <th height="25" width="10%" class="altrow">
                                建单人
                            </th>
                            <th height="25" width="10%" class="altrow">
                                建单日期
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (Wicresoft.UnifyShow.Business.ToDoModel item in todos)
                        {
                            <tr data-type="@item.TypeS">
                                <td height="25">@item.IDS
                                </td>
                                <td height="25">@item.TypeS
                                </td>
                                <td height="25">@item.Operation
                                </td>
                                <td height="25">@item.Description
                                </td>
                                <td height="25">@item.Status
                                </td>
                                <td height="25">@item.Priority
                                </td>
                                <td height="25">@item.AssignGroup
                                </td>
                                <td height="25">@item.Assigner
                                </td>
                                <td height="25">@item.Submitter
                                </td>
                                <td height="25">@item.CreateDate
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>*@